import {Injectable} from '@angular/core';
import {RequestUtil} from "../../../../util/request-util";
import {Observable} from "rxjs/Observable";
import {MsgResult} from "../../../../models/msg-result";
import {MsgAPI} from '../../msg-constants';

@Injectable()
export class RetrieveRegionsService {

  constructor(private request: RequestUtil,) {
  }


  getRetrieveRegionsTree(regionCode: string): Observable<MsgResult> {
    let params = "regionCode=" + regionCode ;
    return this.request.get(MsgAPI.getRetrieveRegionsTree, params);
  }

  getRegionsTreeByRegionCode(regionCode: string): Observable<MsgResult> {
    let params = "regionCode=" + regionCode ;
    return this.request.get(MsgAPI.getRegionsTreeByRegionCode, params);
  }
}
